entry: only notify properties we have
authorMatthias Clasen <mclasen@redhat.com>
Wed, 1 May 2019 04:41:28 +0000 (04:41 +0000)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 1 May 2019 04:41:28 +0000 (04:41 +0000)
GtkText now has the propagate-text-width property,
which is not present on GtkEntry, so we can't just
blindly forward all properties.

gtk/gtkentry.c

index 04d955cea0e30a33be03138b3c81c19f6ddbe5b8..9015c1fb661edfd3b6118eb07d7a04740cf361a5 100644 (file)
@@ -1234,10 +1234,13 @@ notify_cb (GObject    *object,
            gpointer    data)
 {
   gpointer iface;
+  gpointer class;
 
   /* The editable interface properties are already forwarded by the editable delegate setup */
   iface = g_type_interface_peek (g_type_class_peek (G_OBJECT_TYPE (object)), gtk_editable_get_type ());
-  if (!g_object_interface_find_property (iface, pspec->name))
+  class = g_type_class_peek (GTK_TYPE_ENTRY);
+  if (!g_object_interface_find_property (iface, pspec->name) &&
+      g_object_class_find_property (class, pspec->name))
     g_object_notify (data, pspec->name);
 }